package com.net.xpay.common.domain.operator;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.net.common.domain.VersionedDomain;
import com.net.xpay.common.enums.user.ClientFrom;
import com.net.xpay.common.enums.user.SecurityStatus;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.time.LocalDateTime;

/**
 * 2020/4/25 21:01

 * 操盘手
 */
@Getter
@Setter
@NoArgsConstructor
public class OperatorUser extends VersionedDomain {
    /**
     * 以下是基本登陆属性
     */
    @ApiModelProperty(notes = "手机号", example = "18812345678")
    private String mobile;

    @ApiModelProperty(notes = "密码", example = "123456")
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String password;

    /**
     * 系统补充字段
     */
    @ApiModelProperty(notes = "注册时间", example = "2018-12-17 11:52:26")
    private LocalDateTime registerTime;

    @ApiModelProperty(notes = "注册时候的ip", example = "192.0.0.3")
    private String registerIp;

    @ApiModelProperty(notes = "上次登录时间", example = "2018-12-17 11:53:18")
    private LocalDateTime lastLoginTime;

    @ApiModelProperty(notes = "上次的登录来源")
    private ClientFrom lastLoginClient;

    @ApiModelProperty(notes = "最后一次登陆ip", example = "192.0.0.3")
    private String lastLoginIp;

    @ApiModelProperty(notes = "累计登陆次数")
    private Long loginCount;

    /**
     * 安全相关字段
     */
    @ApiModelProperty(notes = "安全状态", example = "0")
    private SecurityStatus securityStatus;

    @ApiModelProperty(notes = "安全备注")
    private String securityRemark;

    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    @ApiModelProperty(notes = "密码输入错误的次数", example = "1")
    private Integer errorCount;
}
